package com.system.dao;

import com.system.entity.Takecourse;
import com.system.entity.Teachcourse;
import com.system.entity.Entergrade;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.CrossOrigin;

import java.util.List;

@Repository
@CrossOrigin
public interface TeachcourseMapper {
    int deleteByPrimaryKey(Integer courseId);
    public List<Teachcourse> findByTeacherId(Long tea_id);
    int insert(Teachcourse record);

    int insertSelective(Teachcourse record);

    Teachcourse selectByPrimaryKey(Integer courseId);

    int updateByPrimaryKeySelective(Teachcourse record);

    int updateByPrimaryKey(Teachcourse record);

    List<Entergrade> findBytea_Id(Long tea_id);
    List<Entergrade> findBySemester(@Param("tea_id") Long tea_id, @Param("semester")String semester);
    List<Entergrade> findByCourseType(Long tea_id, String courseType);
    List<Entergrade> findByCourseID(Long tea_id, Integer course_id);
    List<Entergrade> findByCourseName(Long tea_id, String course_name);
    List<Entergrade> findBySemName(Long tea_id, String semester, String course_name);
    List<Entergrade> findBySemType(Long tea_id, String semester, String courseType);
    List<Entergrade> findBySemId(Long tea_id, String semester, Integer course_id);
    List<Takecourse> findByEveryStudentGrade(@Param("course_id") Integer course_id);
//    List<Takecourse> findByEveryStudentGrade(@Param("tea_id") Long tea_id, @Param("semester") String semester,
//                                             @Param("course_id") Integer course_id);
    List<Takecourse> findByEveryStudent(@Param("course_id") Integer course_id);
    List<Takecourse> findByupdateStudentGrade(@Param("course_id") Integer course_id);
}
